﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace SInvaders
{
    class Aviso
    {
        Texture2D textura;
        int c, limite; // contador
        bool aparecer, aparecendo;

        public Aviso()
        {
            limite = 100;
            aparecer = false;
            aparecendo = false;
        }

        public void LoadContent(ContentManager Content)
        {
            textura = Content.Load<Texture2D>("aviso");
        }

        public void Update()
        {
            if (aparecendo == false)
                c++;
            
            if (c == limite)
                aparecer = true;

            if (aparecendo)
                c--;

            if (c <= 0)
            {
                aparecendo = false;
                aparecer = false;
            }
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            if (aparecer)
            {
                spriteBatch.Draw(textura, new Vector2(0, 0), Color.White);
                aparecendo = true;
            }
        }
    }
}
